<?php


namespace app\api\validate;


use think\Validate;

class ReimburseScene extends Validate
{
    protected $rule = [
        'id' => ["require","number"],
        'reimburse_time' => ['require'],
        'username' => ['require','length'=>'1,10'],
        "price" => ['float','require'],
        "content" => ['require'],
        "status" => ['number','require'],
        "data_state" => ['number','require'],
        "imgs" => ['require'],

    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'reimburse_time.require' => '报销时间不能为空',
        'username.require' => '报销姓名不能为空',
        'username.length' => '报销姓名长度为1-10个字符',
        'id.require' => '职位ID不能为空',
        'id.number' => '职位ID只能为数值',
        'price.require' => '金额不能为空',
        'price.float' => '金额只能为数值',
        'content.require' => '内容不能为空',
        'data_state.number' =>'数据状态必须为数值',
        'data_state.require' =>'未设置状态',
        'status.number' =>'审核状态必须为数值',
        'status.require' =>'审核状态不能为空',
        'imgs.require' =>'报销凭证不能为空',
    ];



    protected $scene = [
        'add'  =>  ['reimburse_time','price','content','imgs'],
        'update'  =>  ['id','reimburse_time','price','content','imgs'],
        'update_state' => ['id',"data_state"],
        'update_status' => ["id","status"]
    ];
}